home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / oath.lha / oath / test / gctest.cc < prev    next >
C/C++ Source or Header  |  1991-08-29  |  821b  |  31 lines

  1. #include "oath/oath.h"
  2.  
  3. #include "timer.h"
  4.  
  5. #include <iostream.h>
  6.  
  7. // Run the following program and monitor from OS.
  8. // It should eat up a lot of memory immediately, then
  9. // eat no more from then on.  If it continues to grow
  10. // then there is a memory leak!
  11.  
  12. #define TOKEN_COUNT 100000
  13.  
  14. main ()
  15.    {cout << "Beginning test.  Press c-C to stop." << endl;
  16.     timer Timer;
  17.     while(1) // loop endlessly, creating and destroying objs
  18.        {Timer.split();
  19.         cout << Timer.real() << " : constructing " 
  20.          << TOKEN_COUNT << " tokens.  Press c-C to stop." << endl;
  21.  
  22.     listA L = dlListA::make();
  23.         for(int I = 0; I < TOKEN_COUNT; ++I)
  24.         L << localTokenA::make();
  25.  
  26.     Timer.split();
  27.         cout << Timer.real() << " : constructed " 
  28.          << TOKEN_COUNT << " tokens.  Press c-C to stop." << endl;
  29.        }
  30.    }
  31.